package com.yatang.yiliao.app.fragments;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.yatang.yiliao.app.R;
import com.yatang.yiliao.app.activities.LoginActivity;
import com.yatang.yiliao.app.activities.MainActivity;
import com.yatang.yiliao.app.activities.PhoneRegisterActivity;


/**
 * A simple {@link Fragment} subclass.
 */
public class TutorialJumpFragment extends Fragment implements View.OnClickListener {


    public TutorialJumpFragment() {

    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        View ret = inflater.inflate(R.layout.fragment_tutorial_jump, container, false);
        View v = ret.findViewById(R.id.tutorial_4_btn);

        if (v != null) {
            v.setOnClickListener(this);
        }

        return ret;
    }


    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.tutorial_4_btn) {
            // TODO 启动主界面，并且关闭自身
            FragmentActivity activity = getActivity();

            activity.startActivity(new Intent(activity, LoginActivity.class));

            activity.finish();
        }
    }
}
